package xhwl.hmo.mall.http.api;


import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.hmo.mall.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/1/16.
 */

public class ApplyCardApi extends BaseApi {
    ApplyCardReq req;
    public ApplyCardApi(String member_mobile,String buy_id,String person_address_id){
        req=new ApplyCardReq(member_mobile,buy_id,person_address_id);
        setShowDialog(true);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).applyCard(requestBody);
    }
    public class ApplyCardReq {
        private String buy_id;
        private String member_mobile;
        private String person_address_id ;
        public ApplyCardReq(String member_mobile,String buy_id,String person_address_id) {
            this.member_mobile = member_mobile;
            this.buy_id=buy_id;
            this.person_address_id=person_address_id;
        }
    }
}
